package com.metroinfo.infrastructure;

import java.util.concurrent.ConcurrentHashMap;

import com.metroinfo.infrastructure.keys.BusInfoDataKey;
import com.metroinfo.infrastructure.value.BusInfoValue;
import com.metroinfo.interfaces.DataStructInterface;

public class BusInfoData implements DataStructInterface{

	ConcurrentHashMap<BusInfoDataKey, BusInfoValue> busInfoData = new ConcurrentHashMap<BusInfoDataKey, BusInfoValue>(2);
	
	public BusInfoData (int i)
	{
		for(int g = 0; g<i; g++)
		{
			BusInfoDataKey busInfoDataKey = new BusInfoDataKey(g);
			BusInfoValue busInfoValue = new BusInfoValue("sada", 15 + g%10);
			
			busInfoData.put(busInfoDataKey, busInfoValue);
		}
	}
	
	public Object getValue(Object busInfoDataKey){
		return busInfoData.get((BusInfoDataKey)busInfoDataKey);
	}
	
	public boolean isExists(Object busInfoDataKey)
	{
		return busInfoData.get((BusInfoDataKey)busInfoDataKey)==null? false:true;
	}
	public boolean refresh(){
		return true;
	}
	
}
